package com.DHH.Service.Capital.Impl;
import com.DHH.Entity.Capital.CapitalSecurityGivebackRecord;
import com.DHH.Mapper.Capital.CapitalSecurityGivebackRecordMapper;
import com.DHH.Service.Capital.ICapitalSecurityGivebackRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CapitalSecurityGivebackRecordServiceImpl implements ICapitalSecurityGivebackRecordService{
	
	@Autowired
    private CapitalSecurityGivebackRecordMapper capitalSecurityGivebackRecordMapper;
    
   @Override
   public CapitalSecurityGivebackRecord insertCapitalSecurityGivebackRecord(CapitalSecurityGivebackRecord capitalSecurityGivebackRecord){
	   
        capitalSecurityGivebackRecordMapper.insertSelective(capitalSecurityGivebackRecord);
	   return capitalSecurityGivebackRecord;
	   
   };
   @Override
   public CapitalSecurityGivebackRecord updateCapitalSecurityGivebackRecord(CapitalSecurityGivebackRecord capitalSecurityGivebackRecord){
	     capitalSecurityGivebackRecordMapper.updateByPrimaryKeySelective(capitalSecurityGivebackRecord);
        return capitalSecurityGivebackRecord;
   };
   @Override
   public CapitalSecurityGivebackRecord deleteCapitalSecurityGivebackRecord(CapitalSecurityGivebackRecord capitalSecurityGivebackRecord){

	     capitalSecurityGivebackRecordMapper.delete(capitalSecurityGivebackRecord);
        return capitalSecurityGivebackRecord;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public CapitalSecurityGivebackRecord saveOrUpdateCapitalSecurityGivebackRecord(CapitalSecurityGivebackRecord capitalSecurityGivebackRecord){
        if(capitalSecurityGivebackRecord.getId()==null)
        {
            capitalSecurityGivebackRecordMapper.insertSelective(capitalSecurityGivebackRecord);
        }else{
            capitalSecurityGivebackRecordMapper.updateByPrimaryKeySelective(capitalSecurityGivebackRecord);
        }
        return capitalSecurityGivebackRecord;
    };
}
